<template>
	<view>
		<view class="listbox">
			<view class="listitem" v-for="(item,index) in list" :key="index" @click="todetail(item)">
				<view class="upbox">
					<image :src="item.url"></image>
					<view v-if="item.is_points_gift == 1" style="position: absolute;right: 10rpx;top: 10rpx;padding: 4rpx 10rpx;background-color: #f09a73;color: white;border-radius: 10rpx;font-size: 24rpx;">送积分</view>
				</view>
				<view class="infobox">
					<view class="namebox">
						{{item.goods_name}}
					</view>
					<!-- <view class="stoke" v-if="item.stock_total">
						{{item.stock_total}}
					</view> -->
					<view style="display: flex;justify-content: space-between;align-items: center;padding: 14rpx 0;">
						<view class="pricebox">
							<text style="font-size: 24rpx;">￥</text>
							{{item.goods_price_min}}
						</view>
						<view class="line-price">
							¥{{item.line_price_max}}
						</view>
						<view class="buy-button">立即购买</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"integralgoods",
		props:{
			list:{
				type:Array,
				default:[],
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			todetail(item){
				uni.navigateTo({
					url:'/pageshop/goodsinfo/goodsinfo?id='+item.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.listbox{
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		width: 690rpx;
		margin: 0 auto;
		justify-content: space-between;
		.listitem{
			display: flex;
			background: #FFFFFF;
			border-radius: 20rpx;
			margin-bottom: 20rpx;
			width: 100%;
			.upbox{
				width: 226rpx;
				height: 226rpx;
				border-radius: 20rpx 20rpx 0rpx 0rpx;
				position: relative;
				image{
					width: 226rpx;
					height: 226rpx;
					border-radius: 20rpx 20rpx 0rpx 0rpx;
				}
			}
			.infobox{
				flex: 1;
				padding: 0 20rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.namebox{
					font-size: 32rpx;
					font-family: Source Han Sans CN-Medium, Source Han Sans CN;
					font-weight: 500;
					color: #222222;
					-webkit-line-clamp: 2;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					overflow: hidden;
					text-overflow: ellipsis;
					margin-top: 20rpx;
				}
				.pricebox{
					font-size: 36rpx;
					font-family: Source Han Sans CN-Medium, Source Han Sans CN;
					font-weight: 500;
					color: #FF6178;
					-webkit-line-clamp: 1;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					overflow: hidden;
					text-overflow: ellipsis;
					margin-top: 20rpx;
				}
				.stoke{
					margin-top: 10rpx;
					font-size: 26rpx;
					color: #666666;
				}
			}
		}
	}
	
	.buy-button{
		padding: 10rpx 24rpx;
		background-color: #FF6178;
		color: white;
		font-size: 28rpx;
		border-radius: 100rpx;
	}
	
	.line-price{
		text-decoration: line-through;
		color: #666666;
		font-size: 28rpx;
		margin-top: 20rpx;
	}

</style>